//
//  SunMapViewController.m
//  playInBackground
//
//  Created by blank on 15/11/10.
//  Copyright © 2015年 blank. All rights reserved.
//

#import "SunMapViewController.h"
#import "SunTools.h"
#import <BaiduMapAPI_Map/BMKMapView.h>
#import <BaiduMapAPI_Location/BMKLocationService.h>
@interface SunMapViewController () <SunBMKToolsDelegate>

@end

@implementation SunMapViewController {
    BMKMapView *_mapView;
    BMKLocationService *_locationService;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    _mapView = [[BMKMapView alloc] initWithFrame:self.view.bounds];
    _mapView.showsUserLocation = YES;
    _mapView.zoomLevel = 15;
    [self.view addSubview:_mapView];
    
//    _locationService = [[BMKLocationService alloc] init];
//    _locationService.delegate = self;
//    [_locationService startUserLocationService];
    
    SunTools *tools = [SunTools shareBMKTools];
    tools.delegate = self;
    
    
    
    // Do any additional setup after loading the view.
}

//- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation {
//    [_mapView updateLocationData:userLocation];
//    _mapView.centerCoordinate = userLocation.location.coordinate;
//}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
//    SunTools *tools = [SunTools shareBMKTools];
//    tools.delegate = self;
}

- (void)getUserLocation:(CLLocationCoordinate2D)coordinate {
    NSLog(@"coo = %@",NSStringFromCGPoint(CGPointMake(coordinate.latitude, coordinate.longitude)));
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
